package com.miyake.dsp.osa.lab.wrapper;

import com.miyake.dsp.converter.MovingAverageScilab;
import com.miyake.dsp.converter.MovingAverageSetting;
import com.miyake.dsp.osa.lab.Calculator;
import com.miyake.dsp.osa.lab.LabUiAnnotation;
@LabUiAnnotation(caption="Moving Average")
public class MovingAverageWrapper extends Calculator {
	public static final String INPUT = "Input";
	public static final String OUTPUT = "Output";
	private MovingAverageSetting setting;

	public MovingAverageWrapper(MovingAverageSetting setting) {
		this.setting = setting;
		initInput(INPUT);
		initOutput(OUTPUT);
	}
	
	@Override
	public synchronized void process() {
		MovingAverageScilab ma = new MovingAverageScilab(setting);
		ma.setSource(this.getInput(INPUT));
		this.setOutput(OUTPUT, ma.getProcessed());
	}

	@Override
	public Object getSetting() {
		return this.setting;
	}

}
